package com.zy.openchat.core.model.call;

import android.os.Parcel;

public class RemoteCallInfo extends CallBaseInfo {
    public long createAt;  //创建时间10位时间戳
    public long closeAt;   //关闭时间10位时间戳
    public long enterAt;   //进入时间10位时间戳
    public long leaveAt;   //离开时间10位时间戳
    public boolean isTimeOut; //是否已经超时

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeLong(this.createAt);
        dest.writeLong(this.closeAt);
        dest.writeLong(this.enterAt);
        dest.writeLong(this.leaveAt);
        dest.writeByte(this.isTimeOut ? (byte) 1 : (byte) 0);
    }

    public RemoteCallInfo() {
    }

    protected RemoteCallInfo(Parcel in) {
        super(in);
        this.createAt = in.readLong();
        this.closeAt = in.readLong();
        this.enterAt = in.readLong();
        this.leaveAt = in.readLong();
        this.isTimeOut = in.readByte() != 0;
    }

    public static final Creator<RemoteCallInfo> CREATOR = new Creator<RemoteCallInfo>() {
        @Override
        public RemoteCallInfo createFromParcel(Parcel source) {
            return new RemoteCallInfo(source);
        }

        @Override
        public RemoteCallInfo[] newArray(int size) {
            return new RemoteCallInfo[size];
        }
    };
}
